package luogu;

import java.util.Scanner;

public class test5 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int[] light=new int[2000001];
        int n=sc.nextInt();

        for (int i = 0; i < light.length; i++) {
            light[i]=0;
        }


        for (int i = 0; i < n; i++) {
            double a = sc.nextDouble();
            int t = sc.nextInt();
            change(light,a,t);
        }

        for (int i = 0; i < light.length; i++) {
                if(light[i]==1){
                    System.out.println(i);
                }
        }
    }

    private static void change(int[] light, double a, int t) {
        for (double j = 1; j <= t; j++) {
        int v=(int)(j*a);
        if(light[v]==1){
            light[v]=0;
        }
        else if(light[v]==0){
            light[v]=1;

        }
    }
    }
}
